import PropTypes from 'prop-types'
import React, { memo } from 'react'
import SectionFooterWrapper from './style'
import IconArrowRight from '@/assets/svg/icon-arrow-right'
import { useNavigate } from 'react-router-dom'

const SectionFooter = memo((props) => {
  const {houseName} = props
  let showName ='查看更多'
  if(houseName){
    showName = `查看更多${houseName}的房源`
  } 

  // 跳转
  const navigate = useNavigate()
  function footerClick(){
    navigate('/entire')
  }
  return (

    <SectionFooterWrapper getcolor={houseName?'#00848A':'#000'}>
      <div className='info' onClick={footerClick}>
        <div className='title'>{showName}</div>
        <IconArrowRight/>
      </div>
    </SectionFooterWrapper>
  )
})

SectionFooter.propTypes = {
  houseName: PropTypes.string
}

export default SectionFooter